-
Notifications
You must be signed in to change notification settings - Fork 0
Persistence + No More Singleton #44
base: main
Are you sure you want to change the base?
Conversation
@Mr-Deej @VoChiDanh |
@Pasarus |
hmmmmm 🤔 |
fileInputStream.close(); | ||
} catch (Exception ex) { | ||
ex.printStackTrace(); | ||
this.data = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you don't want to just exit out if it fails to load? Or are you ok with what I am guessing is a brand new vanilla factions implementation, the issue being what happens after? does it just save over the old bits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm it looks like as of right now if it fails, the data is essentially cleared? Yeah we might want to exit here.
* | ||
*/ | ||
public void save() { | ||
// TODO: implement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably implement this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably over-complicating it, but I have had trouble wrapping my head around how to implement this method with the new system.
fileInputStream.close(); | ||
} catch (Exception ex) { | ||
ex.printStackTrace(); | ||
this.data = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answered above
* | ||
*/ | ||
public void save() { | ||
// TODO: implement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answered above
Getting most recent changes from the main branch.
The data handler classes now implement the data interfaces. This will make it easier to transition to using them instead of the PersistentData class. |
…tead of the PersistentData class.
It is now possible to save faction data, but loading doesn't appear to work correctly. I'm also running into this error upon faction creation:
|
I might move to a database solution for this project, rather than using JSON. |
@alyphen |
The changes in this PR are intended to make factions, power records and territory chunks persistent.